// 导入axios
import request from '@/utils/request'

// 根据分类id获取分类的属性
export function getParamsByCatIdApi(catId, type) {
  return request({
    method: 'GET',
    url: `/categories/${catId}/attributes`,
    params: {
      sel: type
    }
  })
}

// 添加分类属性
export function addParamsApi(catId, data) {
  return request({
    method: 'POST',
    url: `categories/${catId}/attributes`,
    data
  })
}

// 修改分类属性
export function updateParamsApi(catId, attrId, data) {
  return request({
    method: 'PUT',
    url: `categories/${catId}/attributes/${attrId}`,
    data
  })
}
